All Functions Used So Far, Week 3

desc

{dplyr}

Arrange in descending order

nrow

{base}

Get number of rows of a data frame

geom_density

{GGPLOT2}

Generates a density plot

hist

{graphics}

Plot a simple histogram

setwd

{base}

Set Working Directory

ungroup

{dplyr}

Resolve grouping created with “group_by”

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

pie

{graphics}

Creates a basic pie chart

cut

{base}

Convert Numeric to Factor

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

boxplot

{graphics}

Plot a simple box plot

ggplot

{GGPLOT2}

Create a ggplot graph

mutate

{dplyr}

Modify/create a column in a data frame

matrix

{base}

Creates a matrix from the given set of values.

filter

{dplyr}

Filter out rows of a data frame according to logical vector

read.spss

{foreign}

Read a .sav file (SPSS data)

View

{base}

View a data frame

freq

{questionr}

Generate frequency tables

rm

{base}

Remove objects

get_mode

{rstatix}

Compute the mode in a given vector.

order

{base}

Get indexes that will sort a vector

rbind

{base}

Combine R objects by rows

runif

{stats}

Draws ranndom numbers from the uniform distribution

ylab

{GGPLOT2}

Label the y axis (ggplot)

geom_histogram

{GGPLOT2}

Generates a histogram

var

{stats}

Calculate variance

ncol

{base}

Get number of columns of a data frame

factor

{base}

Create a factor

sd

{stats}

Get standard deviation of a vector

median

{stats}

Get median of a vector

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

geom_bar

{GGPLOT2}

Generates a bar chart

lprop

{questionr}

Display row percentages of a two-way frequency table

head

{utils}

Show first 5 rows of a data frame

is.na

{base}

Check if a value is NA/elements of vector are NA

slice

{dplyr}

Subset rows using their positions

levels

{base}

Get levels of a factor

ggtitle

{GGPLOT2}

Generates a title for a ggplot graph

sum

{base}

Get sum of numeric values or a vector

rbeta

{stats}

Beta Random Number Generating Function

install.packages

{base}

Install R package

cbind

{base}

Combine R objects by columns

tabulate

{base}

Counts the number of times each integer occurs in an integer-only vector

mean

{base}

Get mean of a vector

plot

{graphics}

Generic function from base R to produce a plot

as.data.frame

{base}

Functions to check if an object is a data frame, or coerce it if possible.

attach

{base}

Attach Set of R Objects to Search Path

names

{base}

Retrieve names of a list/vector

str

{utils}

Get the structure of an R object

ls.str

{utils}

Similarly to ls, with a print() method that calls str() on each object

ordered

{dplyr}

Create an ordered factor

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

xlab

{GGPLOT2}

Label the x axis (ggplot)

rnorm

{base}

Generate random numbers from a normal distribution

read_excel

{readxl}

Read an Excel file

summary

{base}

Obtain summary statistics or detailed regression output

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

class

{base}

Retrieve class of an R object

seq

{base}

Create a sequence

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

round

{base}

Rounds numbers

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

sample

{base}

Takes a sample of the specified size

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

ifelse

{base}

Return a or b depending on the value of test

unique

{base}

get unique elements

dim

{base}

Get dimensions of a data frame

max

{base}

Get maximum of a vector

c

{base}

Combine values/vectors into a vector

labs

{GGPLOT2}

Customise labels in GGPLOT2

recode

{dplyr}

Recode a variable

min

{base}

Get minimum of a vector

select

{dplyr}

Select columns from a tibble/data frame

library

{base}

Load an R package

set.seed

{base}

Initialise a pseudorandom number generator.

theme_bw

{GGPLOT2}

A black and white ggplot theme

grid.arrange

{gridExtra}

Places graphical objects into a rectangular grid

after_stat

{GGPLOT2}

Control aesthetic evaluation. On the module used for displying percent

which.max

{base}

return index of the largest value in a vector

range

{base}

Return range of values

The end!